﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true"
    CodeBehind="EnterpriseUpdateCorpInfoList.aspx.cs" Inherits="RN.ERP.Web.Enterprise.EnterpriseUpdateCorpInfoList" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="Stylesheet" type="text/css" href="../Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="div1" runat="server">
        <script type="text/javascript">
            function btnSearchClick() {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
            }

            function UpdateCorpType(corpUserGuid, corpName, roleID, classID, areaCode) {
                var dialog = $.ligerDialog.open({ url: "../Enterprise/EnterpriseUpdateCorpInfo.aspx?action=type&corpname=" + escape(corpName) + "&corpguid=" + corpUserGuid + "&roleid=" + roleID + " &classid=" + classID + "&areacode=" + areaCode + "&rand=" + Math.random(), width: 650, height: 570, title: '', buttons: [{ text: "关闭", onclick: function (item, dialog) { btnSearchClick(), dialog.close() } }] });
                $(".l-dialog-close").bind('mousedown', function ()  //dialog右上角的叉
                {
                    btnSearchClick();
                    dialog.close();
                });

            }

            function UpdateCorpArea(corpUserGuid, corpName) {
                $("#ContentPlaceHolder1_hdCorpUserGuid").val(corpUserGuid);
                $("#ContentPlaceHolder1_txtDivCorpName").val(corpName);
                var dialog = $.ligerDialog.open({ url: "../Enterprise/EnterpriseUpdateCorpInfo.aspx?action=zone&corpname=" + escape(corpName) + "&corpguid=" + corpUserGuid + "&rand=" + Math.random(), width: 650, height: 570, title: '', buttons: [{ text: "关闭", onclick: function (item, dialog) { btnSearchClick(), dialog.close() } }] });
                $(".l-dialog-close").bind('mousedown', function ()  //dialog右上角的叉
                {
                    btnSearchClick();
                    dialog.close();
                });
            }

        </script>
    </div>
    <asp:Literal ID="Literal1" runat="server"></asp:Literal>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ListCorps" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div>
                企业名称：<asp:TextBox ID="txtCorpName" runat="server"></asp:TextBox>
                地区：
                <asp:DropDownList ID="ddlAreaCode" runat="server" Width="100px" AutoPostBack="True">
                </asp:DropDownList>
                企业类型：
                <asp:DropDownList ID="ddlCorpType" runat="server" Width="100px" AutoPostBack="True">
                    <asp:ListItem Text="全部" Value="-1"></asp:ListItem>
                    <asp:ListItem Text="施工企业" Value="2501"></asp:ListItem>
                    <asp:ListItem Text="装饰装修企业" Value="2506"></asp:ListItem>
                    <asp:ListItem Text="门窗企业" Value="2301"></asp:ListItem>
                    <asp:ListItem Text="商砼企业" Value="30"></asp:ListItem>
                </asp:DropDownList>
                <input type="button" value="查 询" id="btnSearch" onclick="btnSearchClick()" style="width: 50px" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <telerik:RadGrid ID="ListCorps" runat="server" AutoGenerateColumns="True" CellSpacing="0"
        Width="100%" Culture="zh-CN" GridLines="None" AllowFilteringByColumn="False"
        AllowPaging="true" AllowCustomPaging="true" AllowMultiRowSelection="true" OnNeedDataSource="ListCorps_NeedDataSource"
        AllowSorting="false" ShowStatusBar="true">
        <ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" EnableRowHoverStyle="true">
            <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"
                AllowColumnResize="True"></Resizing>
        </ClientSettings>
        <MasterTableView AutoGenerateColumns="false" DataKeyNames="ID">
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
            </RowIndicatorColumn>
            <Columns>
                <telerik:GridTemplateColumn DataField="ID" HeaderText="ID" UniqueName="ID" ReadOnly="true"
                    Visible="false">
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="CorpName" HeaderText="企业名称" HeaderStyle-Width="200px">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn HeaderText="企业类型" HeaderStyle-Width="80px">
                    <ItemTemplate>
                        <%#TranCorpTypeByClassid(Eval("ClassID")) %>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="AreaName" HeaderText="地区" HeaderStyle-Width="60px">
                </telerik:GridBoundColumn>
                <%--<telerik:GridBoundColumn DataField="EndTime" HeaderText="注册时间" HeaderStyle-Width="150px">
                </telerik:GridBoundColumn>--%>
                <telerik:GridBoundColumn DataField="StrFlowCode" HeaderText="审核状态" HeaderStyle-Width="60px">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn HeaderText="" HeaderStyle-Width="80px">
                    <ItemTemplate>
                        <input id="btnUpdateCorpType" type="button" value="修改企业类型" onclick="UpdateCorpType('<%#Eval("CorpUserGuid") %>','<%#Eval("CorpName") %>','<%#Eval("RoleId") %>','<%#Eval("classID") %>','<%#Eval("AreaCode") %>')" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="" HeaderStyle-Width="80px">
                    <ItemTemplate>
                        <input id="btnUpdateCorpManageZone" type="button" value="修改企业管理地" onclick="UpdateCorpArea('<%#Eval("CorpUserGuid") %>','<%#Eval("CorpName") %>')" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings EnableRowHoverStyle="true">
        </ClientSettings>
        <PagerStyle AlwaysVisible="True" />
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
    </telerik:RadGrid>
</asp:Content>
